import { IsNotEmpty } from "class-validator";
import { IsComfirm } from "src/common/rules/is-confirm.rule";
import { IsNotExistsRule } from "src/common/rules/is-no-exists.rule";

export default class RegisterDto {
 
  @IsNotEmpty({ message: '用户名不能为空' })
  @IsNotExistsRule('user', { message: '用户名已存在' })
  name: string;
  @IsNotEmpty({ message: '密码不能为空' })
  @IsComfirm({ message: '两次密码不一致' })
  password: string;
  @IsNotEmpty({ message: '二次确认密码不能为空' })
  password_confirm: string;
}